#include "analysisDialog.h"

AnalysisDialog::AnalysisDialog(Object *_object, QWidget *_parent) : QDialog(_parent){
    setWindowTitle(QString::fromUtf8("Análise do objeto ").append(QString::number(_object->getId())));

    QLabel *objectArea = new QLabel(QString::number(_object->area()));

    QHBoxLayout *objectAreaLayout = new QHBoxLayout;
    objectAreaLayout->addWidget(objectArea);

    QGroupBox *objectGroupBox = new QGroupBox(QString::fromUtf8("Área: "));
    objectGroupBox->setLayout(objectAreaLayout);


    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    buttonBox->setLocale(QLocale(QLocale::Portuguese, QLocale::Brazil));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(objectGroupBox);
    mainLayout->addWidget(buttonBox);
    mainLayout->addStretch(1);

    setLayout(mainLayout);
}

AnalysisDialog::~AnalysisDialog(){
}
